package com.homegoods.login.ui;

import android.support.v4.app.Fragment;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.homegoods.aroutercomment.ARouterPath;
import com.homegoods.login.R;
import com.homegoods.login.databinding.LoginUserLoginActivityBinding;
import com.homegoods.login.ui.fragment.AuthCodeFragment;
import com.homegoods.login.ui.fragment.LoginPhoneFragment;
import com.kedll.library.base.MyBaseFragmentActivity;
import com.kedll.library.mvp.BasePresenter;

import com.kedll.library.util.MyUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * add shibo.zheng 19/06/10
 * 用户登录界面activity（其中包含验证码登录和账户密码登录）
 */

@Route(path = ARouterPath.PATH_USER_LOGIN)
public class UserLoginActivity extends MyBaseFragmentActivity<LoginUserLoginActivityBinding, BasePresenter> {
    private List<Fragment> fragments;

    @Override
    protected int getLayout() {
        return R.layout.login_user_login_activity;
    }

    @Override
    protected void initEvent() {
        toolbar.setNavigationIcon(R.drawable.login_ic_close);
        fragments = new ArrayList<>();
        String[] titles = getResources().getStringArray(R.array.login_title_name);
        fragments.add(new AuthCodeFragment());
        fragments.add(new LoginPhoneFragment());
        mBinding.viewpager.setPagingEnabled(false);
        MyUtils.bindViewPagerAndTabLayout(getSupportFragmentManager(), fragments, titles, mBinding.viewpager, mBinding.tabLayout);
    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }
}
